<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<%@page import="logic.newLogic2.Facade3"%>
<%@page import="guiDisplay.UserData"%>
<%
	UserData user = null;
	if ((String) session.getAttribute("currentUser") == null) {
		response.sendRedirect("login.jsp");
	} else {
		user = Facade3.getInstance().getUserDetails(
				(String) session.getAttribute("currentUser"));
	}
%>
<html>
<head>
<title>secret 4 plus dog</title>
<meta http-equiv="Content-Type"
	content="text/html; charset=windows-1255">
<link href="secret4.css" rel="stylesheet" type="text/css">
</head>

<body bgcolor="#FF6600" dir="ltr">
<a href="login.jsp">Logout</a>    <a href="userPanel.jsp">Main panel</a>
<table height="100%" width="100%" border="0" cellspacing="3"
	cellpadding="2">
	<tr>
		<td width="10%">&nbsp;</td>
		<td valign="top">
		<table height="100%" width="100%" border="0" cellspacing="3"
			cellpadding="2">
			<tr height="20%">
				<td>&nbsp;</td>
			</tr>
			<tr height="80%">
				<td>
				<table align="left" width="100%" border="0" cellspacing="3"
					cellpadding="2">
					<tr>
						<td width="65%" align="left" valign="top">
						<table width="100%" border="0" cellspacing="3" cellpadding="2">
							<tr>
								<td class="title">Change Details</td>
							</tr>
							<tr>
								<td>
								<form name="changeDetails" method="post" action="facade.jsp">
								<table width="100%" border="0" cellspacing="3" cellpadding="2">
									<tr>
										<td>&nbsp;</td>
									</tr>
									<tr>
										<td><input type="hidden" name="form"
											value="changeDetails">
										<table class="bolded" width="100%" border="0" cellspacing="3"
											cellpadding="2">

											<tr>
												<td width="40%">Old Password:</td>
												<td><input type="password" name="oldPassword"></td>
											</tr>
											<tr>
												<td>Sex:</td>
												<td><select name="sex">
													<option value="male">Male</option>
													<option value="female"
														<%if (user != null && user.getSex())
				out.println("selected=\"selected\"");%>>Female</option>
												</select></td>
											</tr>
											<tr>
												<td>New Password:</td>
												<td><input type="password" name="newPassword"></td>
											</tr>

											<tr>
												<td>Retype Password:</td>
												<td><input type="password" name="reNewPassword"></td>
											</tr>

											<tr>
												<td>Birth Date:</td>
												<td><select name="day">
													<%
														if (user != null) {
															for (int i = 1; i <= 31; i++) {
																out
																		.println("<option value=\""
																				+ i
																				+ "\""
																				+ ((user.getDay().equals("" + i)) ? " selected=\"selected\""
																						: "") + ">" + i + "</option>");
															}
														}
													%>
												</select>&nbsp; <select name="month">
													<%
														if (user != null) {
															for (int i = 1; i <= 12; i++) {
																out
																		.println("<option value=\""
																				+ i
																				+ "\""
																				+ ((user.getMonth().equals("" + i)) ? " selected=\"selected\""
																						: "") + ">" + i + "</option>");
															}
														}
													%>
												</select>&nbsp; <select name="year">
													<%
														if (user != null) {
															for (int i = 1910; i <= 2008; i++) {
																out
																		.println("<option value=\""
																				+ i
																				+ "\""
																				+ ((user.getYear().equals("" + i)) ? " selected=\"selected\""
																						: "") + ">" + i + "</option>");
															}
														}
													%>
												</select></td>
											</tr>
											<tr>
												<td>&nbsp;</td>
											</tr>
											<tr>
												<td>&nbsp;</td>
											</tr>
											<tr>
												<td class="error" colspan="2">
												<%
													String err = request.getParameter("Error");
													if (err != null)
														out.println(err);
												%>
												</td>
											</tr>
											<tr>
												<td>&nbsp;</td>
											</tr>
										</table>

										</td>
									</tr>
									<tr>
										<td align="center"><input type="submit" name="submit"
											value="Submit"> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <!--input
											type="submit" name="cancel" value="Cancel"--></td>
									</tr>
								</table>
								</form>
								</td>
							</tr>
						</table>
						</td>
						<td><img src="Secret4PlusDog.jpg" width="220" height="407"></td>
					</tr>
				</table>
				</td>
			</tr>
		</table>
		</td>
		<td width="10%">&nbsp;</td>
	</tr>
</table>

</body>
</html>
